﻿#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
using MilwormsGameData;
#endregion

namespace MilwormsGameContentPipeline
{
    [ContentTypeWriter]
    public class GiftWriter : MilwormsGameWriter<Gift>
    {
        EquipmentWriter equipmentWriter = null;

        protected override void Initialize(ContentCompiler compiler)
        {
            equipmentWriter = compiler.GetTypeWriter(typeof(Equipment))
                as EquipmentWriter;

            base.Initialize(compiler);
        }

        protected override void Write(ContentWriter output, Gift value)
        {
            output.WriteRawObject<Equipment>(value as Equipment, equipmentWriter);
        }

        public override string GetRuntimeType(TargetPlatform targetPlatform)
        {
            return typeof(MilwormsGameData.Gift).AssemblyQualifiedName;
        }

        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {
            return typeof(MilwormsGameData.Gift.GiftReader).AssemblyQualifiedName;
        }
    }
}
